package com.banmao.algorithm.No201To300.No206;

public class Answer {

    public static void main(String[] args) {
        ListNode head = new ListNode();

        ListNode listNode = new ListNode(2, null);
        listNode = new ListNode(1, listNode);

        head = listNode;

        Solution2 solution1 = new Solution2();
        ListNode result = solution1.reverseList(head);

        ListNode cur = result;
        while (cur != null) {
            System.out.println(cur.val);
            cur = cur.next;
        }

    }

}
